home *** CD-ROM | disk | FTP | other *** search
- property ancestor, qtMovie, movieControlsLocation, movieControlSpriteList, movieLoc, offStage, motion, viewButtonList
- global gSoundManager, gButtonManager, gPathDelim
-
- on new me
- set the ancestor of me to new(script "popUpObjectScript")
- set qtSprite to 47
- set movieLoc to point(516, 384)
- set qtMovie to new(script "quickTimeObjectScript", qtSprite, movieLoc)
- set movieControlsLocation to point(517, 358)
- set movieControlSpriteList to [20, 21, 22, 23, 24]
- set offStage to point(-1000, -1000)
- set viewButtonList to []
- return me
- end
-
- on mShowPopUp me, memberName
- if the type of member memberName = #richText then
- set the loc of sprite the popUpSprite of me to point(160, 120)
- else
- set the loc of sprite the popUpSprite of me to point(320, 240)
- end if
- set the member of sprite the popUpSprite of me to member memberName
- updateStage()
- set the popRect of me to the rect of sprite the popUpSprite of me
- set the mouseDownScript to "mMouseDown(gPopUp)"
- mGetHotSpotData(me, memberName)
- mStopSound(gSoundManager)
- mInitMovieArea(me)
- mShowMovieArea(me)
- end
-
- on mMouseDown me
- if the optionDown then
- mGetRect(me)
- else
- set clickLocation to the clickLoc
- if inside(clickLocation, the popRect of me) then
- do("mClosePopUp(gPopUp)")
- else
- if getPos([21, 22, 23, 24], the clickOn) then
- pass()
- else
- beep()
- end if
- end if
- end if
- dontPassEvent()
- end
-
- on mClosePopUp me
- mHideMovieArea(me)
- set the mouseDownScript to EMPTY
- set the member of sprite the popUpSprite of me to member "dummyPixel"
- updateStage()
- set hotSpotList to []
- set actionList to []
- end
-
- on mInitMovieArea me
- end
-
- on mShowMovieArea me
- repeat with aSprite in movieControlSpriteList
- puppetSprite(aSprite, 1)
- set the loc of sprite aSprite to movieControlsLocation
- end repeat
- mInitMovie(qtMovie)
- mSetDefaultMovie(me)
- mSetMovieLoc(qtMovie, movieLoc)
- mPlay(qtMovie, 1, 0)
- add(viewButtonList, mAddButton(gButtonManager, 21, "FrontViewButton", "mPlayMovie(gPopUp, #front)"))
- add(viewButtonList, mAddButton(gButtonManager, 22, "BackViewButton", "mPlayMovie(gPopUp, #back)"))
- add(viewButtonList, mAddButton(gButtonManager, 23, "SideViewButton", "mPlayMovie(gPopUp, #side)"))
- add(viewButtonList, mAddButton(gButtonManager, 24, "TopViewButton", "mPlayMovie(gPopUp, #top)"))
- end
-
- on mHideMovieArea me
- repeat with aSprite in movieControlSpriteList
- set the loc of sprite aSprite to offStage
- end repeat
- mHideMovie(qtMovie)
- mdispose(qtMovie)
- repeat with aButton in viewButtonList
- mDeleteButton(gButtonManager, aButton)
- end repeat
- set viewButtonList to []
- end
-
- on mSetDefaultMovie me
- set aMotionLabel to the name of member the member of sprite the popUpSprite of me
- set motionID to (1 * (aMotionLabel contains "pitch")) + (2 * (aMotionLabel contains "roll")) + (3 * (aMotionLabel contains "yaw"))
- case motionID of
- 1:
- set motion to #p
- 2:
- set motion to #r
- 3:
- set motion to #y
- end case
- mPlayMovie(me, #front)
- end
-
- on mPlayMovie me, aView
- set motionString to string(motion)
- set view to string(aView)
- set movieName to "motion" & gPathDelim & motionString & view & ".mov"
- mChangeMovie(qtMovie, movieName)
- end
-